package com.geeaks.learn.zxing;

import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Maps;

public class QRCodeTest {
	
	public static void main(String args[]) throws Exception {
		String filePath = "/Users/geeaks/Desktop/a.jpg";
		String str = QRCodeTools.deEncodeByPath(filePath);
		String[] array = StringUtils.split(str, ",");
		Map<String,String> voucherType = Maps.newHashMap();
		voucherType.put("10", "增值税电子普通发票");
		voucherType.put("04", "增值税普通发票");
		voucherType.put("01", "增值税专用发票");
		Invoice invoice = new Invoice();
		invoice.setType(voucherType.get(array[1]));
		invoice.setCode(array[2]);
		invoice.setNumber(array[3]);
		invoice.setAmount(array[4]);
		invoice.setDate(array[5]);
		System.err.println(JSON.toJSONString(invoice));
	}
}
